<?php
echo validation_errors();
$form = array(
    'id'    => 'form-editplayer',
    'class' => 'ut-form row'
);
$team = array();
foreach($teams as $ti=>$tv)
    $team[$ti] = $tv['name'];
echo form_open_multipart('team/insert_player',$form);
echo form_fieldset();
echo '<ul class="span5">';
echo '<li>'.form_label('Imię i nazwisko:','fname')
        .form_input(array('name'=>'fname','placeholder'=>'Imię','class'=>'medium'),set_value('fname',$user['fname']))
        .form_input(array('name'=>'lname','placeholder'=>'Nazwisko','class'=>'medium'),set_value('lname',$user['lname'])).'</li>';
echo '<li>'.form_label('Data urodzenia: ','data_urod').'<input type="date" name="data_urod" class="small ut-datepicker" value="'.set_value('data_urod',$user['birth']).'" id="urod-datepicker" placeholder="RRRR-MM-DD"/></li>';
echo '<li>'.form_label('Email:','email').form_input(array('name'=>'email','placeholder'=>'Wpisz adres email','class'=>'medium'),set_value('email',$user['email'])).'</li>';
echo '<li>'.form_label('Telefon:','phone').form_input(array('name'=>'phone','placeholder'=>'Wpisz numer telefonu','class'=>'medium'),set_value('phone',$user['phone'])).'</li>';
echo '<li>'.form_label('Drużyna:','team').form_dropdown('team',$team,set_value('team',$user['tid'])).'</li>';
echo '<li>'.form_label('Dołączył: ','joined').'<input type="date" name="joined" class="small ut-datepicker" value="'.set_value('joined',$user['joined']).'" id="join-datepicker" placeholder="RRRR-MM-DD"/></li>';
echo '<li>'.form_label('Pozycja:','pos[]').form_multiselect('pos[]',$pos,set_value('pos[]',$user['pos'])).'</li>';
echo '<li>'.form_label('Numer:','numer').form_input(array('name'=>'numer','placeholder'=>'Wpisz numer na koszulce','class'=>'medium'),set_value('numer',$user['number'])).'</li>';
echo '<li>'.form_label('Zdjęcie: ','image').form_upload('image').'</li>';
echo '</ul>';
echo '<figure class="span3">'
        .'<img src="'.(empty($user['image']) ? place_img(300,300) : base_url($this->config->item('image_user_path').$user['image'])).'" class="thumbnail"/>'
    .'</figure>';
echo form_fieldset_close();
echo form_hidden('uid',$uid);
echo '<p class="clear">'.form_submit('edit_player','Aktualizuj dane','class="btn-primary btn-large"').'</p>';
echo form_close();
?>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js"></script>